package com.xbfinance.portal.service.impl;

import com.xbfinance.portal.dao.P2pAccountBankMapper;
import com.xbfinance.portal.pojo.po.P2pAccount;
import com.xbfinance.portal.pojo.po.P2pAccountBank;
import com.xbfinance.portal.service.AccountBankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class AccountBankServiceImpl implements AccountBankService {
    @Autowired
    P2pAccountBankMapper p2pAccountBankMapper;

    @Override
    public Map<String, Object> InsertAccount(P2pAccountBank p2pAccountBank) {
        Map<String,Object> map = new HashMap<>();
        int i = 0;
        try {
            i = p2pAccountBankMapper.insertSelective(p2pAccountBank);
        }catch (Exception e){
            System.out.println(e);
            System.out.println("添加失败");
            map.put("flag","0");
            return map;
        }
        if(i!=0){
            map.put("flag",1);
        }else {
            map.put("flag",0);
        }
        return map;
    }
}
